-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenStack LBaaS v2 Support #7012
Conversation
Can anyone give some guidance on how to bump the gophercloud version up to 67139b9485d6fd682c5314e963b0915e18f7947a ? Once that is done the integration tests should be able to build and run. |
@dkalleg This is so awesome - thank you! I did a quick read through the code and it looks great. There's some nits with regard to the embedded formatting in the tests, but that always happens and wouldn't block a merge. I think this should be able to get merged in time for 0.7. With regard to the gophercloud version, Terraform just switched from |
@@ -105,6 +105,11 @@ func Provider() terraform.ResourceProvider { | |||
"openstack_lb_monitor_v1": resourceLBMonitorV1(), | |||
"openstack_lb_pool_v1": resourceLBPoolV1(), | |||
"openstack_lb_vip_v1": resourceLBVipV1(), | |||
"openstack_lbaas_loadbalancer_v2": resourceLoadBalancerV2(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that LBaaS v1 used the /lb/
URL and LBaaS v2 uses the lbaas
URL, so I understand why you chose to use lbaas
in the name... but I wonder if the resources should keep lb
and LB
in their names for consistency... Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no strong feeling either way. Unless someone else chimes in before Monday, I'll push an update for this.
f76112f
to
d0c39f2
Compare
Not sure what the conflict github is reporting is. Side effect of changing a vendor project? Thoughts? |
@dkalleg It looks like there were 117 files pulled in from gophercloud. That seems like a very large number... I would imagine the commit should just be the lbaasv2 stuff. Maybe that's where the conflict is coming from? |
@jtopjian My intention was to bring up gophercloud to its latest revision, which would include a lot of other changes. Are you recommending I try to pull in just the lbaasv2 gophercloud changes? |
@dkalleg hm... my understanding from using Godep was that the PR contains the diff between what's currently in |
@jtopjian I removed the _test.go files from the gophercloud update, down to 38 files changed from 117 :) . I also refactored the resource naming from lbaas to lb. |
@@ -1,5 +1,6 @@ | |||
{ | |||
"comment": "", | |||
<<<<<<< 8c3ff933951a5ab0111c0ef6b3553e42e4ce14af |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks leftover from a merge conflict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sorry. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping on this one. Looks like it still exists?
@dkalleg Thank you for your patience with this one! It's never fun to be caught in between a core refactor like the current Godep to Govendor one right now... |
@jtopjian No worries! Was mostly a painless process and taught me about govendor. |
@dkalleg I'm in the process of setting up the OpenStack acceptance test environment for LBaaS v2. Once that's done, I'll run these acceptance tests through it. In the meantime, I'm going to do a more thorough review of the code and make some inline comments. |
d.Set("default_pool_id", listener.DefaultPoolID) | ||
d.Set("connection_limit", listener.ConnLimit) | ||
d.Set("sni_container_refs", listener.SniContainerRefs) | ||
d.Set("default_tls_container_ref", listener.DefaultTlsContainerRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For d.Set
to work correctly, the arguments must have Computed: true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what doesn't work correctly if Computed: false
? I ask because in testing I:
- Create a listener w/ TF.
- Note the "name" field (just calling out this attr arbitrarily) was properly populated.
- Manually change the listeners name in OpenStack.
- Call
terraform plan
with no changes to the .tf script - Note the plan output wants to change the listeners name from what I manually set to what is in the .tf script:
name: "foo" => "tf_test_listener" (forces new resource)
I do notice that the terraform.tfstate does not show the name as "foo" after the plan. I tried adding Computed: true
to the name attr and re-ran through this process with the same results.
My current understanding of the Computed attribute is that its for schema elements that the user may not provide, but if that info can be captured during a Read(), you can then write it back to the tfstate via d.Set() BUT it will not cause a terraform plan
to consider this field as a "user change". The id
schema element is the prime example. Please do correct me if this is wrong or incomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, fyi, I realized I don't need a ForceNew: true on name :) I'll fix that and go review all the other attrs.
@dkalleg Looks like there are three areas to work on:
Once devstack is set up, I'll run everything through and see what the result is. By far, though, this is a great PR! I think the above items are minor compared to the rest of the work you put into this (docs, great tests, etc). |
return &schema.Resource{ | ||
Create: resourceListenerV2Create, | ||
Read: resourceListenerV2Read, | ||
Delete: resourceListenerV2Delete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtopjian I just realized, I missed adding the Update:
entry here! But.. how could the test cases have passed if I missed this? Fixing this in my next patch.
@dkalleg Re #2: I ran some tests and fiddled with some code and surprised myself - it looks like I was able to get a working devstack installation with LBaaS. I found that I had to increase the timeout of the Once I made that change, all tests passed! But I also noticed that the files were still called Once that's done, I'd say squash everything into two commits: one for the Terraform resources and one for the Govendor dependencies. Then I'll see if someone else can sign off on Govendor stuff just to make sure the commit doesn't mess anything up. Then we should be good to go. 😄 |
@jtopjian Done |
@dkalleg Looks like that one line is still floating around |
CRUD, tests and Docs for managing a LoadBalancer, Listener, Pool, Member, and Monitor resources.
@jtopjian Ah, sorry. Should be fixed now. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Gives support for LBaaS V2. Relies on a recent PR that's been merged to GopherCloud master: rackspace/gophercloud#575